package model;

import java.math.BigInteger;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

public class Encryption {

	public static String encrypt(String text) {
		try {
			MessageDigest md5 = MessageDigest.getInstance("MD5");
			md5.update(text.getBytes());
			BigInteger dis = new BigInteger(1, md5.digest());
			text = dis.toString(18);
		} catch (NoSuchAlgorithmException e) {
			e.printStackTrace();
		}
		return text;
	}

	public static String encrypt(char[] text) {
		return encrypt(text.toString());
	}

	public static void main(String[] args) {
		// System.out.println(encrypt("adminHaricSilver"));
		// 24dggh20054d8hfb388861h71d6deg7
		System.out.println("AdmIn".toLowerCase());
	}
}
